package com.googlecode.imanager.client.util;

import java.util.Set;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public interface Selection extends Set<Integer> {

    void setMode(SelectionMode mode);

    SelectionMode getMode();

    void setFocused(int focusedItem);

    int getFocused();

    void setSelected(int itemIndex);

    int getSelected();

    int getMaxRange();

    int getPageRange();

    /**
     * Checks if the item is in a valid range. <br/>
     * Note that number less than zero should always be invalid.
     * 
     * @param itemIndex
     *            the item
     * @return True if the item can be focused/added/removed in this selection
     */
    boolean isValidItem(int itemIndex);

}